{__NOLAYOUT__}
<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>wechat js sdk</title>
	</head>

	<body>
		<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
		<script>
			wx.config({
				debug: true,
				appId: '{$wxConfig.appId}',
				timestamp: "{$wxConfig.timestamp}",
				nonceStr: '{$wxConfig.nonceStr}',
				signature: '{$wxConfig.signature}',
				jsApiList: [
					'checkJsApi',
					'onMenuShareTimeline',
					'onMenuShareAppMessage',
					'onMenuShareQQ',
					'onMenuShareWeibo',
					'hideMenuItems',
					'showMenuItems',
					'hideAllNonBaseMenuItem',
					'showAllNonBaseMenuItem',
					'translateVoice',
					'startRecord',
					'stopRecord',
					'onRecordEnd',
					'playVoice',
					'pauseVoice',
					'stopVoice',
					'uploadVoice',
					'downloadVoice',
					'chooseImage',
					'previewImage',
					'uploadImage',
					'downloadImage',
					'getNetworkType',
					'openLocation',
					'getLocation',
					'hideOptionMenu',
					'showOptionMenu',
					'closeWindow',
					'scanQRCode',
					'chooseWXPay',
					'openProductSpecificView',
					'addCard',
					'chooseCard',
					'openCard'
				]
			});
			var shareData = { 
			    title: '分享标题',
			    desc: '分享内容',
			    link: 'http://baidu.com',
			    imgUrl: 'http://www.baidu.com/img/bdlogo.png', 
			    success: function () { 
			        // 用户确认分享后执行的回调函数
			        alert('share ok');
			    },
			    cancel: function () { 
			        // 用户取消分享后执行的回调函数
			    }
			}
			
			wx.ready(function(){
			    alert("ready");
				wx.checkJsApi({
				    jsApiList: ['onMenuShareTimeline'], // 需要检测的JS接口列表，所有JS接口列表见附录2,
				    success: function(res) {
				        // 以键值对的形式返回，可用的api值true，不可用为false
				        // 如：{"checkResult":{"chooseImage":true},"errMsg":"checkJsApi:ok"}
				    }
				});
			   wx.onMenuShareTimeline(shareData);
			   wx.onMenuShareAppMessage(shareData);
			});
			wx.error(function(res){
			    alert(res);
			});
		</script>
	</body>

</html>

{:dump($vars)}
